package com.xhtt.modules.task.event;

import com.xhtt.common.utils.SpringContextUtils;
import com.xhtt.modules.task.entity.TaskCarTask;
import com.xhtt.modules.task.entity.TaskCarTaskUser;
import com.xhtt.modules.task.service.TaskCarTaskService;
import com.xhtt.modules.task.service.TaskCarTaskUserService;
import org.springframework.context.ApplicationEvent;

public class AfterCarPlanEvent extends ApplicationEvent {

    TaskCarTaskService taskCarTaskService = SpringContextUtils.getBean(TaskCarTaskService.class);

    private Integer planId;

    public AfterCarPlanEvent(Integer planId) {
        super(planId);
        this.planId = planId;
    }

    public void createSub() {
        TaskCarTask t = new TaskCarTask();
        t.setCarPlanId(planId);
        taskCarTaskService.save(t);
    }
}
